package userwashlogic

import (
	"context"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/dao/model/userwash"

	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/rpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type AddUserWashDescLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewAddUserWashDescLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddUserWashDescLogic {
	return &AddUserWashDescLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// rpc userWashDesc 洗码描述
func (l *AddUserWashDescLogic) AddUserWashDesc(in *rpc.AddUserWashDescRequest) (*rpc.AddUserWashDescResponse, error) {
	if err := userwash.NewUserWashDescModel(l.ctx, l.svcCtx.Db).Add(in.Language, in.Description, in.Status, in.AccountId); err != nil {
		return nil, err
	}
	return &rpc.AddUserWashDescResponse{}, nil
}
